<template>
	<div>
		<div class="banner" @click="handleBannerClick">
			<img class="banner-img" :src="this.bannerImg">
			<div class="banner-info">
				<div class="banner-title">
					{{this.sightName}}
				</div>
				<div class="banner-number">
					<span class="iconfont banner-icon">&#xe63a;</span>
					{{this.bannerImgs.length}}
				</div>
			</div>
		</div>
		<fade-animation>
			<common-gallary
			:imgs="bannerImgs"
			v-show="showGallary"
			@close="handleGallaryClose"
			>
			</common-gallary>
		</fade-animation>
	</div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/FadeAnimation'
export default{
	name: 'DetailBanner',
	props: {
		sightName: String,
		bannerImg: String,
		bannerImgs: Array,
	},
	components: {
		CommonGallary,
		FadeAnimation,
	},
	data () {
		return {
			showGallary: false,
			// imgs: ['http://img1.qunarzz.com/sight/p0/201403/07/c2a1247cea6066443c4ad60ad73f4106.jpg_r_800x800_38ecaffc.jpg', 'http://img1.qunarzz.com/sight/p0/1509/73/73dd844b95a20711.water.jpg_r_800x800_550d4e9b.jpg', 'http://img1.qunarzz.com/sight/p0/201402/11/ae4bbbb461e5c0f4d5b6ec444200f5e8.jpg_r_800x800_b2cd2bc8.jpg', 'http://img1.qunarzz.com/sight/p0/1508/a9/75cae71b532b4e1d8cf8cb6d91b0eb40.water.jpg_r_800x800_9c5a1e1b.jpg', 'http://img1.qunarzz.com/sight/p0/1509/99/99273e37786b0dbf.water.jpg_r_800x800_974c022e.jpg', 'http://img1.qunarzz.com/sight/p0/1509/22/225bb60bf86ba7a8.water.jpg_r_800x800_d4cb074a.jpg']
		}
	},
	methods: {
		handleBannerClick () {
			this.showGallary = true
		},
		handleGallaryClose () {
			this.showGallary = false
		}
	}
}
</script>

<style lang="stylus" scoped>
	.banner
		position: relative
		overflow: hidden
		height: 0
		padding-bottom: 55%
		.banner-img
			width: 100%
		.banner-info
			display: flex
			position: absolute
			left: 0
			right: 0
			bottom: 0
			line-height: .6rem
			color: #fff
			background: linear-grandient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8))
			.banner-title
				flex: 1
				font-size: .32rem
				padding: 0 .2rem
			.banner-number
				height: .32rem
				margin-top: .12rem
				padding: 0 .4rem
				line-height: .32rem
				border-radius: .2rem
				background: rgb(0, 0, 0, .8)
				font-size: .24rem
				.banner-icon
					font-size: .24rem
</style>